home *** CD-ROM | disk | FTP | other *** search
- //////////
- //
- // File: VRSpeech.h
- //
- // Contains: Speech recognition support for QuickTime VR movies.
- //
- // Written by: Tim Monroe
- //
- // Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
- //
- // Change History (most recent first):
- //
- // <1> 12/05/96 rtm ported earlier speech recognition support functions to VRShell
- //
- //////////
-
- // header files
-
- #include <SpeechRecognition.h>
- #include <AppleEvents.h>
- #include <Timer.h>
- #include <QuickTimeVR.h>
- #include "QTUtilities.h"
-
- // miscellaneous constants
-
- #define FloatToFixed(a) ((Fixed)((float)(a) * fixed1))
- #define VRPi (3.1415926535898)
- #define VRDegreesToRadians(a) ((a) * VRPi / 180.0)
- #define VRRadiansToDegrees(a) ((a) * 180.0 / VRPi)
-
- #define kLMResourceType 'LMDL'
- #define kLMResourceID 129
-
- #define kSpinMillisecsDelay 25 //empirically determined
-
- // an expanded Time Manager record
- // we use this to manage the spinning around
- typedef struct MyTMTask {
- TMTask theTMTask;
- long theSpinDir;
- long theSpinAmt;
- long theSpinDelay;
- QTVRInstance theInstance;
- } MyTMTask, *MyTMTaskPtr;
-
-
- // function prototypes
- void VRSpeech_Init (void);
- void VRSpeech_Stop (void);
- PASCAL_RTN OSErr VRSpeech_HandleSpeechBegunAppleEvent (AppleEvent *theAEevt, AppleEvent* reply, long refcon);
- PASCAL_RTN OSErr VRSpeech_HandleSpeechDoneAppleEvent (AppleEvent *theAEevt, AppleEvent* reply, long refcon);
- OSErr VRSpeech_ReadLanguageModelsFromResource (void);
- Boolean VRSpeech_GoDirByDegrees (QTVRInstance theInstance, long theDir, long theAmt);
- Boolean VRSpeech_GoDirByRadians (QTVRInstance theInstance, long theDir, long theAmt);
- void VRSpeech_ZoomInOrOut(QTVRInstance theInstance, long theDir);
- void VRSpeech_DoEventLoopSpinCheck (void);
- Boolean VRSpeech_IsSpinning (void);
- void VRSpeech_StartSpinning (QTVRInstance theInstance, long theDir);
- void VRSpeech_StopSpinning (void);
- PASCAL_RTN OSErr VRSpeech_SpeakNameOfNode (QTVRInstance theInstance, long nodeID, SInt32 refCon);
- void VRSpeech_InstallSpeechFeedbackRoutine (QTVRInstance theInstance);
-
-